﻿using RRKAutohaus.Model;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RRKAutohaus.Core.EntityFramework.Configuration
{
    public class CommentsConfig: EntityTypeConfiguration<Comments>
    {
        //1 blog has zero or more comments
        public CommentsConfig()
        {
            HasOptional(comments => comments.Blog)
                .WithMany(blog => blog.Comments)
                .HasForeignKey(blog => blog.BlogId);

        }
    }
}
